﻿using ProjScan.RecordManager.AssetData;
using ProjScan.ScanRule.Attr;
using UnityEditor;
using UnityEngine;

namespace ProjScan.ScanRule.SceneCheck
{
    [ScenesCheckRuleAttr]
    internal class Scene_RenderingPath : SceneObjRecordRuleImp
    {
        protected override bool IsOK(SceneObjAssetData assetData)
        {
            Camera component = assetData.gameObj.GetComponent<Camera>();
            if (component != null && (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android || EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS) && (component.actualRenderingPath == RenderingPath.DeferredLighting || component.actualRenderingPath == RenderingPath.DeferredShading))
            {
                return false;
            }

            return true;
        }
    }
}